#include <vector>
#include <algorithm>

using namespace std;

struct Fragment {
    int length;
    int offset;
};

vector<Fragment> fragmentPacket(int packetLength, const vector<int>& pathMTUs) {
    vector<Fragment> fragments;
    if (packetLength <= 0 || pathMTUs.empty()) {
        return fragments;
    }

    int pathMTU = *min_element(pathMTUs.begin(), pathMTUs.end());

    int maxDataPerFragment = pathMTU - 20;
    if (maxDataPerFragment <= 0) {
        return fragments;
    }
    
    int remainingLength = packetLength;
    int currentOffset = 0;
    
    while (remainingLength > 0) {
        int fragmentDataLength = min(remainingLength, maxDataPerFragment);
        int fragmentTotalLength = fragmentDataLength + 20;
        
        fragments.push_back({fragmentTotalLength, currentOffset});
        
        currentOffset += fragmentDataLength;
        remainingLength -= fragmentDataLength;
    }
    
    return fragments;
}